import request from '@/service'
import { DataItem } from '@/@types/setting'

enum Api {
  menu = '/api/menu',
  editmenu = '/api/editmenu'
}

// 获取折叠菜单
export const getMenu = () => {
  return request.get(Api.menu)
}

// 获取菜单
export const getEditMenu = () => {
  return request.get(Api.editmenu)
}

// 修改菜单
export const editMenu = (data: DataItem, id: number) => {
  return request.put(`${Api.editmenu}/${id}`, data)
}

// 修改菜单
export const deleteMenu = (id: number) => {
  return request.delete(`${Api.menu}/${id}`)
}
